
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
using namespace std;

void Test1()
{
    int n = 0;
    string s;
    cin >> n;

    s = to_string(n);
    reverse(s.begin(), s.end());

    int cnt = 0;
    for (auto it = s.begin(); it != s.end();)
    {
        if (cnt && 0 == cnt % 3)
        {
            cnt = 0;
            it = s.insert(it, ',');
            ++it;
        }
        else
        {
            ++it;
            ++cnt;
        }
    }
    reverse(s.begin(), s.end());

    cout << s << endl;
}

void Test2()
{
    int n = 0;
    cin >> n;
    vector<int> dp(n + 1, 1);

    for (int i = 2; i <= n; ++i)
    {
        dp[i] = dp[i - 1] + dp[i - 2];
    }

    cout << dp[n] << endl;
}


bool IsContinuous(vector<int>&numbers)
{
    bool res = false;
    int cnt0 = 0, cnt1 = 0, cnt2 = 0;
    sort(numbers.begin(), numbers.end());

    for (int i = 0, n = numbers.size(); i < n; ++i)
    {
        if (0 == numbers[i])
        {
            ++cnt0;
        }
        else
        {
            if (i < n - 1 && numbers[i] + 1 == numbers[i + 1])
                ++cnt1;
            if (i < n - 1 && numbers[i] + 1 != numbers[i + 1])
            {
                if (numbers[i] + 2 == numbers[i + 1])
                    ++cnt2;
                else
                    break;
            }
        }

        if (4 == cnt0)
        {
            res = true;
            break;
        }
    }

    ++cnt1;
    if ((5 == cnt1) ||
        (5 == cnt1 + cnt0) ||
        (cnt0 == cnt2 && 5 == cnt2 + 1 + cnt0) ||
        (cnt0 >= cnt2 && 5 == cnt0 + 1 + cnt1))
        res = true;

    return res;
}

void Test2()
{
    int res = 0;
    int n = 0;
    cin >> n;

    if (0 == n)
        cout << res << endl;

    int curprice = 0, myprice = 0;

    for (int i = 0; i < n; ++i)
    {
        cin >> curprice;

        if (0 == i)
            myprice = curprice;
        else
        {
            if (curprice < myprice)
                myprice = curprice;
            else
                res = max(res, curprice - myprice);
        };
    }

    cout << res << endl;

}
int main()
{
    Test1();

	return 0;
}